import {
  getListFn,
  scoreFn
} from "../api/exam";
let state = {
  type: '',
  list: [],
  current: 0,
  times: 0
}
let mutations = {
  setType(state, type) {
    state.type = type
  },
  setList(state, obj) {
    state.list = obj.data
  },
  setCurrent(state, current) {
    state.current = current
  },
  setTimes(state, times) {
    state.times = times
  }
}
let actions = {
  async getList({
    commit
  }) {
    let {
      data
    } = await getListFn()
    console.log(data);
    commit('setList', data)
  },
  // 成绩
  async getScore({ }, form) {
    await scoreFn(form)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}